//
//  GMSkeletonView.h
//  gentleman
//
//  Created by 范月成 on 2017/12/18.
//  Copyright © 2017年 fancy. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CommonDefines.h"

#define kDefaultBackgroundColor kColorMake(240, 238, 244, 1)
#define kDefaultContainerBackgroundColor kColorMake(248, 248, 248, 1)

@class GMSkeletonView;
@protocol GMSkeletonLayoutProtocol <NSObject>

@required
- (NSArray<GMSkeletonView *> *)skeletonLayout;
@optional
- (UIColor *)skeletonBackgroundColor;

@end

@interface GMSkeletonView : UIView

@property (nonatomic, strong) UIColor *bgColor;

@end

@interface UIView (GMSkeleton)

@property (nonatomic, strong, readonly) UIView *container;

- (void)skeletonStartAnimation;

- (void)skeletonStopAnimation;

@end

@interface GMSkeletonDataSourceProvider : NSObject<UITableViewDataSource, UITableViewDelegate>

/**
 default 15
 */
@property (nonatomic, assign) NSInteger numberOfRowsInSection;

- (instancetype)initWithCellReuseIdentifier:(NSString *)reuseIdentifier;

+ (instancetype)dataSourceProviderWithCellReuseIdentifier:(NSString *)reuseIdentifier;

@end
